<template>
  <div>
    <div class="father">
      我是父组件-----我将值传给子组件
      <div>
        <Input
          v-model="value"
          placeholder="Enter something..."
          style="width: 260px;margin-right:20px"
        />
        <Button type="primary" @click.native="toChildValue">清空</Button>
      </div>
    </div>

    <div class="child">
      <my-child :value="value"></my-child>
    </div>
  </div>
</template>

<script>
import MyChild from "./../ChildCompoment/MyChild";
export default {
  name: "MyFather",
  components: { MyChild },
  data() {
    return {
      value: ""
    };
  },
  methods: {
    toChildValue: function() {
      this.value = "";
    }
  }
};
</script>

<style scoped>
.father {
  height: 300px;
  border: 1px solid gray;
  margin-left: 20px;
  padding: 10px;
}
.child {
  margin-top: 20px;
  height: 300px;
  border: 1px solid black;
  margin-left: 20px;
  padding: 10px;
}
</style>